home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / hdf / unix / examples.lha / examples / err / errF.f < prev    next >
Encoding:
Text File  |  1991-10-09  |  745 b   |  34 lines

  1. C  
  2. C  Testing existence of global variable DFerror.
  3. C
  4. C  Note: "textfile" should not exist;  otherwise no error is reported.
  5. C        The error code reported should be -1.
  6. C
  7. C
  8.  
  9.  
  10.       program errexample
  11.  
  12.       integer  dsgdims, dferrno, DFerror
  13.       integer ret, rank, sizes(3)
  14.  
  15.       ret = dsgdims('textfile', rank, sizes, 3)
  16.       DFerror =  dferrno()
  17.  
  18.       print *
  19.       print *,'  return value = ', ret
  20.       print *,'  DFerror      = ', DFerror
  21.       print *
  22.  
  23.       if (ret .lt. 0 .and. DFerror .eq. -1) then
  24.       print *,'Test of error reporting successful !'
  25.       else
  26.       print *,'Test of error reporting failed !'
  27.           print *, 'Return value should be < 0; DFerror should be -1.'
  28.       end if
  29.       print *
  30.  
  31.       stop
  32.       end
  33.  
  34.